﻿using UnityEngine;
using System.Collections;

public class CameraNormal : CameraBase {

    private Vector3 _eulerAngles = Vector3.zero;
    private Vector3 _position = Vector3.zero;
    public void Start() {
        _eulerAngles = transform.eulerAngles;
        _position = transform.position;
    }

    public override void Tick() {
        base.Tick();
        if (Input.GetMouseButton(1)) {
            _eulerAngles.y -= Input.GetAxis("Mouse X") * 2;
            _eulerAngles.x += Input.GetAxis("Mouse Y") * 2;
            transform.eulerAngles = _eulerAngles;
        }

      
        transform.position = _position * (1 - Input.GetAxis("Mouse ScrollWheel"));
        _position = transform.position;

    }

    public override void Reset() {
        base.Reset();
        transform.position = _position;
        transform.eulerAngles = _eulerAngles;
    }
}
